<template>
  <div class="q-pa-md text-center">
    <div class="inline-block">
      <div class="column items-center">
        <q-avatar size="72px">
          <img src="https://cdn.quasar.dev/img/boy-avatar.png" alt="">
        </q-avatar>
        <div class="text-subtitle1 q-my-sm ellipsis">
          <span>{{ this.$store.state.userInfo.name || '-----' }}</span>
          <span v-if="this.$store.state.userInfo.role === 99">{{
              this.$store.state.userInfo._id.slice(-6)
            }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { UserInfo } from 'src/store/tool/state'
import { defineComponent } from 'vue'

export default defineComponent({
  name: 'UserSmallPanel',
  data () {
    return {
      darkMode: false,
      keepLogin: false
    }
  },
  computed: {
    userInfo () {
      return this.$store.state.userInfo as UserInfo
    }
  },
  methods: {

    async setting () {
      await this.$router.push({ name: 'Setting' })
    }
  }
})
</script>

<style scoped>

</style>
